﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Silverlight3dApp.Learning.Lesson03
{
    public class AutomatedSprite : Sprite
    {
        public AutomatedSprite(Texture2D texture, Vector2 position, Vector2 frameSize, int collisionOffset, Vector2 currentFrame, Vector2 sheetSize, Vector2 speed) : base(texture, position, frameSize, collisionOffset, currentFrame, sheetSize, speed)
        {
        }

        public AutomatedSprite(Texture2D texture, Vector2 position, Vector2 frameSize, int collisionOffset, Vector2 currentFrame, Vector2 sheetSize, Vector2 speed, int millisecondsPerFrame) : base(texture, position, frameSize, collisionOffset, currentFrame, sheetSize, speed, millisecondsPerFrame)
        {
        }

        public override Vector2 Direction
        {
            get
            {
                return _Speed;
            }
        }

        public override void Update(GameTime gameTime, Rectangle clientBounds)
        {
            base.Update(gameTime, clientBounds);
            _Position += Direction;
        }
    }
}